Detecting changes in lung volume with hypoxemia episodes